<template>
  <div class="service-banners">
    <div class="banner-row">
      <div class="service-banner" @click="handleServiceClick('家服')">
        <div class="banner-content">
          <div class="service-icon">
            <img src="@/assets/imgs/customer.svg" alt="硅谷家服" />
          </div>
          <div class="service-text">
            <h4>硅谷家服</h4>
            <p>服务保优质保优惠</p>
          </div>
        </div>
      </div>
      
      <div class="service-banner" @click="handleServiceClick('智能')">
        <div class="banner-content">
          <div class="service-icon">
            <img src="@/assets/imgs/switch.svg" alt="硅谷智能" />
          </div>
          <div class="service-text">
            <h4>硅谷智能</h4>
            <p>全屋智能家居服务</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ElMessage } from 'element-plus'

const handleServiceClick = (service) => {
  ElMessage.info(`点击了硅谷${service}`)
}
</script>

<style scoped>
.service-banners {
  margin: 0 16px 20px;
}

.banner-row {
  display: flex;
  gap: 12px;
}

.service-banner {
  flex: 1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.service-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.banner-content {
  display: flex;
  align-items: center;
}

.service-icon {
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.service-icon img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.service-text {
  color: white;
}

.service-text h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.service-text p {
  font-size: 12px;
  margin: 0;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .service-banners {
    margin: 0 12px 16px;
  }
  
  .banner-row {
    gap: 8px;
  }
  
  .service-banner {
    padding: 12px;
  }
  
  .service-icon {
    width: 36px;
    height: 36px;
    margin-right: 8px;
  }
  
  .service-icon img {
    width: 20px;
    height: 20px;
  }
  
  .service-text h4 {
    font-size: 14px;
  }
  
  .service-text p {
    font-size: 11px;
  }
}
</style>
